UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mQsLH2tn7TfCVknxy9Ip9mrZhgE6Tp6V2VlKG1lqtIM='
WHERE
key_id = '1b6c4326f30c807da7917717169e58149fd3719ebf08db8d178ee0b4b1606e3c'
AND (
token = 'mQsLH2tn7TfCVknxy9Ip9mrZhgE6Tp6V2VlKG1lqtIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)