UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yRJKWOMiewoogO0iGZA7EnKfTkbOhpGQPIG8A/wBtHg=' 
WHERE 
  key_id = 'a932aae00ec5f00dcc72dcf2c0e42c3a2c72269677c8998532fbbfc353d9bf9d' 
  AND (
    token = 'yRJKWOMiewoogO0iGZA7EnKfTkbOhpGQPIG8A/wBtHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039