UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JdrQHBeS671I/0dE2YSK0RV/WmvfPZcDXVtYLMqeygY='
WHERE
key_id = '9758996128928537f8ace42f28e1d26813395b279b03565c2baa4fdff96802c3'
AND (
token = 'JdrQHBeS671I/0dE2YSK0RV/WmvfPZcDXVtYLMqeygY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)