UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SgNHLVqqhqo0nsLr/y1JouQttZO63x6BoG3lr76JcVY='
WHERE
key_id = 'bc62112e9daa77aa95bd3a82c2a8877f629bb2421104ca88142537bbd7ac9e24'
AND (
token = 'SgNHLVqqhqo0nsLr/y1JouQttZO63x6BoG3lr76JcVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)