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