UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lOvYPvoJfemSO7ernwB/CH5b/AYw7diQHNn0klrox7I='
WHERE
key_id = 'c3ba0e070eef21508d9128a49141501d20710795e394f0a78fce2f0408d82c3a'
AND (
token = 'lOvYPvoJfemSO7ernwB/CH5b/AYw7diQHNn0klrox7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)