UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tYQnwnB/nu9SxS2VTy+ScmwS7ZVTG+dCwLPxJejbt9k=' 
WHERE 
  key_id = '03065b4bd06a8d0692f9ac4dd4477b28babab4cdb4733d24840284cd0afeacec' 
  AND (
    token = 'tYQnwnB/nu9SxS2VTy+ScmwS7ZVTG+dCwLPxJejbt9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021