UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9qhCWCtlBLSvT7Pv8Y9Z6J3ilX5WbvtS9LLH/GXcRq4=' 
WHERE 
  key_id = 'ccd6ef23aa08ef5af0e7c927bf796ee72c91bc533e4ada7d92047d5e6dcb2dd9' 
  AND (
    token = '9qhCWCtlBLSvT7Pv8Y9Z6J3ilX5WbvtS9LLH/GXcRq4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046