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

Query time 0.00029