UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rZD/ttlu4HEoBuU7SURTvSJIqs8vDzw9MEyWQlfEdE8='
WHERE
key_id = '1cac3604b8a7320ea2cafe1337bb8fc8bc8c0e836955bd824e6c483b2bb8f5ba'
AND (
token = 'rZD/ttlu4HEoBuU7SURTvSJIqs8vDzw9MEyWQlfEdE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)