UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '32Cy236pOOVNUbSJ2/d6NyJ8qS/tMW41LQtMPyq+HwU=' 
WHERE 
  key_id = '12e1fc2bfcc37b0750f66ea9405f8bbc6e98b61999252fc6e88b1a61d7da458c' 
  AND (
    token = '32Cy236pOOVNUbSJ2/d6NyJ8qS/tMW41LQtMPyq+HwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040