UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O5Avkb/HKT8vMAkKJkJCp++JCWlFW2Xy7d2dtY1N7gs='
WHERE
key_id = '20cf1e971a58bffbd15473416fc444fb608fd6b657978d9128c53afda0d60dce'
AND (
token = 'O5Avkb/HKT8vMAkKJkJCp++JCWlFW2Xy7d2dtY1N7gs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)