UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Geqh0XordzHj+beLvIZX9aP5lRXSWLjFFWJ5mvTgMOY='
WHERE
key_id = '8cb855a8a56ed37156846898b23dfd7f28e1f76b4e48feda88a0c76123580f8d'
AND (
token = 'Geqh0XordzHj+beLvIZX9aP5lRXSWLjFFWJ5mvTgMOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)