UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9/pIaTeLyYL6PLxYws5gBP6N+DOlnnedwdENEgOi2Xg=' 
WHERE 
  key_id = '51f42e207f929ef55c2dd7fc96d30a5e76b67d49b0a7462aaca28cd31c67129c' 
  AND (
    token = '9/pIaTeLyYL6PLxYws5gBP6N+DOlnnedwdENEgOi2Xg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046