UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DSYa5PXi/dnJd1vLnWD5q8rI25f0BreHpaDl/Dc9lmg='
WHERE
key_id = '5bd0d6988d861027aae805b564b8a2ef5dc17bdfc9d3eac5b1c258b257fb4d13'
AND (
token = 'DSYa5PXi/dnJd1vLnWD5q8rI25f0BreHpaDl/Dc9lmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)