UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eIcWxUJiiPm0TACYqFg1027vukqG9g98XQyRfeoBkF0='
WHERE
key_id = 'ad4ae140ce1454650e8e08780984e3fdee598fb94893bb459f29c9a4bb594aca'
AND (
token = 'eIcWxUJiiPm0TACYqFg1027vukqG9g98XQyRfeoBkF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)