UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BcAxyDQ+KwS3FyRflbpfjLYUMDf213TQ37MtZFre49Q='
WHERE
key_id = '2d9ec6d3b3b6bbede8915368777d5330a30974631da112f432bf1235041bf48d'
AND (
token = 'BcAxyDQ+KwS3FyRflbpfjLYUMDf213TQ37MtZFre49Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)