UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wKJpJ5ufhrFHkG8zoVF8kqdGeAD1erxyxE4jcFxwEZc=' 
WHERE 
  key_id = '4e2664ce33d582e1df2a85c69db5c6a85dee6435fe30b1ae4636588f9d6ac9a2' 
  AND (
    token = 'wKJpJ5ufhrFHkG8zoVF8kqdGeAD1erxyxE4jcFxwEZc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034