UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vhHoM5a2ueBoOSit0su43rTnI4BPreWPOx3TuOFzl/o=' 
WHERE 
  key_id = '93827cec82804a19dd803c12160587d9902ee625f6f0c3d3ad592c006ecb7d49' 
  AND (
    token = 'vhHoM5a2ueBoOSit0su43rTnI4BPreWPOx3TuOFzl/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028