UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9VzkLGlxuxbN1AR5WL7GsQlQh2MiiONcOGqPQ8hP0rU=' 
WHERE 
  key_id = 'c431df899d603ee328d4ce4569a00a098f0fbb7ec7a1d37e91c8eb1a1715368d' 
  AND (
    token = '9VzkLGlxuxbN1AR5WL7GsQlQh2MiiONcOGqPQ8hP0rU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033