UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B1Gj7eTK1ZNeBmzyo2ntr8qC6oWvFM/s/CPe0h0KNkc=' 
WHERE 
  key_id = '7f1c5b1fb77edc59c8fcb6a84065bf18da9cf7e8ffba0231166eb0fa77591ac2' 
  AND (
    token = 'B1Gj7eTK1ZNeBmzyo2ntr8qC6oWvFM/s/CPe0h0KNkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054