UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iHLJeQSAhWb6G7+SjNX5Vbbp/IhdG8e2o8uNTwtWDxM='
WHERE
key_id = '0ae3f277dfcd0b96cd50cbc149561b7327e52ec2a288c16b824fbed893cb5f03'
AND (
token = 'iHLJeQSAhWb6G7+SjNX5Vbbp/IhdG8e2o8uNTwtWDxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)