UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6yHcW/YuflKqC7QbRvmGmZIKybqVBZaVrjQldgIFkkY=' 
WHERE 
  key_id = 'd5b72cf88de76b7e7f8c07becb159dbccb517044f2e4ef5e1762419b319be884' 
  AND (
    token = '6yHcW/YuflKqC7QbRvmGmZIKybqVBZaVrjQldgIFkkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042