UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WoXvcpQj+UhXgWDeOg29tj8DSE5WmrKzh0j2KtYwl9A=' 
WHERE 
  key_id = '772d51191676087a5f944bd125a856ef2af8d581bec856212a902cab7e256017' 
  AND (
    token = 'WoXvcpQj+UhXgWDeOg29tj8DSE5WmrKzh0j2KtYwl9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021