UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tymHychsp0ruCfJHAdTAWY8As4Qcd9k5MtUydYhmqrA='
WHERE
key_id = '44085af100b267ba3c775d2f331eda50de73d285594dd98eb17384e0085faf3c'
AND (
token = 'tymHychsp0ruCfJHAdTAWY8As4Qcd9k5MtUydYhmqrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)