UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SlJ/8nSVXGeOL0OS1pduiu62FSuSOSTfpgJ8G/Wpr+Q='
WHERE
key_id = 'f7c06f4a3974f80df17c255ba792a9ac7cf35fa8a82a81c7d0db06625817985f'
AND (
token = 'SlJ/8nSVXGeOL0OS1pduiu62FSuSOSTfpgJ8G/Wpr+Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)