UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nFZ+f8Q5tBWNC8E9fyLoGWr0uHpSXr3pzbG/CaRTqd4=' 
WHERE 
  key_id = '6c7de3d95dead192946181969105e71521625ab3d1c2c32a54a5dafadf6e8b2f' 
  AND (
    token = 'nFZ+f8Q5tBWNC8E9fyLoGWr0uHpSXr3pzbG/CaRTqd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018