UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lv3oZWKElw2Vh2PX2zMpLBYl9YOTd0yI2zWF3G3v0tg=' 
WHERE 
  key_id = 'b538c027b2b09aec8c59fa4899bb08ee8d83599ddf5baf39e37775efdabfee7a' 
  AND (
    token = 'Lv3oZWKElw2Vh2PX2zMpLBYl9YOTd0yI2zWF3G3v0tg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033