UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pxIuFoJ1lV9soYxmOpsGTMYjlyBjvs7XB+AMOP6XOAg=' 
WHERE 
  key_id = 'b1c6bec57bf3d04224d1769f330fa40f1efc35f0dbee24df466c4c5b2116d69c' 
  AND (
    token = 'pxIuFoJ1lV9soYxmOpsGTMYjlyBjvs7XB+AMOP6XOAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032