UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XdQc3CtbBz1r16WDA9ktra6onCNqsA/8XhkWgg0Q778='
WHERE
key_id = 'cc704cc9c2f4b5f0e4d7a11f7a63adaa28b07e643cc78ba00be6648aebdb4a95'
AND (
token = 'XdQc3CtbBz1r16WDA9ktra6onCNqsA/8XhkWgg0Q778='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)