UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vuv5+mUvuTGK/jRY7jB0Pm5PdpLLJd0sWK7/jU3gbwQ=' 
WHERE 
  key_id = 'a5a554869853f7f8b2fc6db5d8c45b8969cd0acc8ab33ec646ede923ad1dd409' 
  AND (
    token = 'Vuv5+mUvuTGK/jRY7jB0Pm5PdpLLJd0sWK7/jU3gbwQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027