UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pdgzBM8OEEASCT+/vKIo1XVqDSy02ObgWfhxCA1C7Ds='
WHERE
key_id = 'bf86839c6f0c32dfa1ffb10f7a033cb3fba543f5e8fd120b95e4154732fa7e59'
AND (
token = 'pdgzBM8OEEASCT+/vKIo1XVqDSy02ObgWfhxCA1C7Ds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)