UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uuGolaK5fS55b9G1cKMSMmkBrpcvibnvqa/EMxeeelY='
WHERE
key_id = 'f58ea03fe96a9f6c25cd2c9a0e7dc09455e5f91a3d100da630452fbbdc63d9ae'
AND (
token = 'uuGolaK5fS55b9G1cKMSMmkBrpcvibnvqa/EMxeeelY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)